package com.lcy.springtest.bean;

import lombok.Data;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

/**
 * @author lichenyang
 * @create 2021-04-19 10:29 上午
 */
@Data
public class Person1 implements InitializingBean, DisposableBean {
    public Person1(){
        System.out.println("无参构造方法");
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("执行销毁方法");
    }
    /**
     * bean 创建完成 并且属性赋值完成后调用
     * @throws Exception
     */
    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("执行afterPropertiesSet方法");
    }
}
